<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>The source code</title>
  <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  <style type="text/css">
    .highlight { display: block; background-color: #ddd; }
  </style>
  <script type="text/javascript">
    function highlight() {
      document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
    }
  </script>
</head>
<body onload="prettyPrint(); highlight();">
  <pre class="prettyprint lang-js"><span id='global-property-'>/**
</span> * @ignore
 * render for dialog
 * @author yiminghe@gmail.com
 */
KISSY.add(&quot;overlay/dialog-render&quot;, function (S, OverlayRender, DialogTpl) {
    function _setStdModRenderContent(self, part, v) {
        part = self.control.get(part);
        part.html(v);
    }

    return OverlayRender.extend({
        beforeCreateDom: function (renderData) {
            S.mix(renderData.elAttrs, {
                role: 'dialog',
                'aria-labelledby': 'ks-stdmod-header-' + this.control.get('id')
            });
        },

        createDom: function () {
            this.fillChildrenElsBySelectors({
                header: '#ks-stdmod-header-{id}',
                body: '#ks-stdmod-body-{id}',
                footer: '#ks-stdmod-footer-{id}'
            });
        },

        getChildrenContainerEl: function () {
            return this.control.get('body');
        },

        '_onSetBodyStyle': function (v) {
            this.control.get(&quot;body&quot;).css(v);
        },

        '_onSetHeaderStyle': function (v) {
            this.control.get(&quot;header&quot;).css(v);
        },
        '_onSetFooterStyle': function (v) {
            this.control.get(&quot;footer&quot;).css(v);
        },

        '_onSetBodyContent': function (v) {
            _setStdModRenderContent(this, &quot;body&quot;, v);
        },

        '_onSetHeaderContent': function (v) {
            _setStdModRenderContent(this, &quot;header&quot;, v);
        },

        '_onSetFooterContent': function (v) {
            _setStdModRenderContent(this, &quot;footer&quot;, v);
        }
    }, {
        ATTRS: {
            contentTpl: {
                value: DialogTpl
            }
        },
        HTML_PARSER: {
            header: function (el) {
                return el.one(&quot;.&quot; + this.getBaseCssClass('header'));
            },
            body: function (el) {
                return el.one(&quot;.&quot; + this.getBaseCssClass('body'));
            },
            footer: function (el) {
                return el.one(&quot;.&quot; + this.getBaseCssClass('footer'));
            },
            headerContent: function (el) {
                return el.one(&quot;.&quot; + this.getBaseCssClass('header')).html();
            },
            bodyContent: function (el) {
                return el.one(&quot;.&quot; + this.getBaseCssClass('body')).html();
            },
            footerContent: function (el) {
                var footer = el.one(&quot;.&quot; + this.getBaseCssClass('footer'));
                return footer &amp;&amp; footer.html();
            }
        }
    });
}, {
    requires: ['./overlay-render', './dialog-xtpl']
});</pre>
</body>
</html>
